
TARGET_cli = sample_lindzcfg_cli
TARGET_srv = sample_lindzcfg_srv

SRC = sample_lindzcfg.c

LOCAL_INCLUDE = -I$(FRAMEWORK_DIR)/base/lindutils \
	-I$(FRAMEWORK_DIR)/base/lindzcfg

LOCAL_LIBRIARY = -lpthread \
	-L$(OUT_DIR)/lib/ \
	-lldutils -lldzcfg

all: client server

client:
	$(CC) $(SRC) -o $(TARGET_cli) -DZCFG_MODE=0 $(LOCAL_LIBRIARY) $(LOCAL_INCLUDE)
	$(INSTALL) $(TARGET_cli) $(OUT_DIR)/bin/$(TARGET_cli)
	rm -rf $(TARGET_cli) $(OBJFILE)

server:
	$(CC) $(SRC) -o $(TARGET_srv) -DZCFG_MODE=1 $(LOCAL_LIBRIARY) $(LOCAL_INCLUDE)
	$(INSTALL) $(TARGET_srv) $(OUT_DIR)/bin/$(TARGET_srv)
	rm -rf $(TARGET_srv) $(OBJFILE)

clean:
	rm -rf $(OUT_DIR)/bin/$(TARGET_cli) $(OUT_DIR)/bin/$(TARGET_srv)
